#!/bin/bash

sudo kubeadm reset
#k8s reset之后彻底清除上次初始化
sudo iptables -F && sudo iptables -t nat -F && sudo iptables -t mangle -F && sudo iptables -X
sudo systemctl stop kubelet
sudo ipvsadm --clear

rm -rf .kube/ && \
sudo rm -rf /var/lib/cni/* && \
sudo rm -rf /var/lib/kubelet/ && \
sudo rm -rf /etc/cni/ && \
sudo rm -rf /etc/kubernetes/

sudo ifconfig tunl0 down
sudo ip link delete tunl0@NONE
sudo ip link delete tunl0
sudo ifconfig vxlan.calico down
sudo ip link delete vxlan.calico
sudo ip link delete kube-ipvs0
